package com.choosefine.springboot.devops.base.result;

/**
 * Created by Administrator on 2017/1/9 0009.
 */
public class ReturnMSG<T> {
    private Integer code;
    private String msg;
    private T data;

    public ReturnMSG<T> success(T data){
        code=200;
        msg="OK";
        this.data=data;
        return this;
    }
    public ReturnMSG<T> success(){
        code=200;
        msg="OK";
        return this;
    }

    public ReturnMSG<T> error(){
        code=500;
        msg="ERROR";
        return this;
    }

    public ReturnMSG<T> error(String info){
        code=500;
        msg=info;
        return this;
    }

    public ReturnMSG<T> paramError(){
        code=500;
        msg="paramError";
        return this;
    }
    public ReturnMSG<T> uploadError(){
        code=500;
        msg="uploadError";
        return this;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
